architecture rtl of cross_product is
  signal I : unsigned ( 2 downto 0);
  signal ai, bi : sig8;
  signal product, add_in, sum, accumulator : signed (15 downto 0);
begin
control: process (clk) 
begin
  if clk’event and clk = ‘1’ then
    if reset = ‘1’ then
      i <= (others => ‘0’);
    else
      i <= i + 1;
    end if;
  end if;
end process;
a_mux: ai <= a(i);
b_mux <= bi <= b(i);
multiply: product <=ai * bi;
z_mux: add_in <= X”000” when i = 0 else accumulator;

accumulate: process (clk)
begin
  if clk’event and clk = ‘1’ then
    accumulator <= sum;
  end if;
end process;

output : result <= accumulator;
end;